package com.richapp.launcher.control;


import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.jack.netty.log.LoggerManager;


/**
 * Created by jack on 2015/3/24 0024.
 */
public class PageControl {

    private static PageControl pageControl;
    private Context context;

    private PageControl(){

    }

    public static PageControl getInstance(){
        if(pageControl == null){
            pageControl = new PageControl();
        }
        return pageControl;
    }

    public void backHome(){
        String command = "input keyevent HOME";
        ControlProcess.getInstance().doCommand(9);
        LoggerManager.getInstance().getiLogger().info(getClass(), "返回主页");
    }

    public void popMenu(){
        //String command = "input keyevent MENU";
        ControlProcess.getInstance().doCommand(1);
        LoggerManager.getInstance().getiLogger().info(getClass(), "弹出系统菜单");
    }

    public void confirm(){
        //String command = "input keyevent DPAD_CENTER";
        ControlProcess.getInstance().doCommand(5);
        LoggerManager.getInstance().getiLogger().info(getClass(), "确认");
    }

    public void backPre(){
        //String command = "input keyevent BACK";
        ControlProcess.getInstance().doCommand(7);
        LoggerManager.getInstance().getiLogger().info(getClass(), "返回上页");
    }

    public void power(){
        //String command = "input keyevent POWER";
        ControlProcess.getInstance().doCommand(0);
        LoggerManager.getInstance().getiLogger().info(getClass(), "电源按键");
    }

    public void screenOn(){
        //String command = "input keyevent POWER";
        ControlProcess.getInstance().doCommand(0);
        LoggerManager.getInstance().getiLogger().info(getClass(), "");
    }

    public void screenOff(){
        //String command = "input keyevent POWER";
        ControlProcess.getInstance().doCommand(0);
        LoggerManager.getInstance().getiLogger().info(getClass(), "电源按键");
    }

    public Context getContext() {
        return context;
    }

    public void setContext(Context context) {
        this.context = context;
    }
}
